package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.example.bean.Product;

import java.util.List;

public interface ProductDao {
    public List<Product>list();
    @Delete("DELETE FROM `product`WHERE id =#{id}")
    public Void del(int id);
    @Insert("INSERT INTO product(name,uname,tel,text)VALUES(#{name},#{uname},#{tel},#{text})")
    public void add(Product product);
    @Update("UPDATE product SET `name`=#{name},uname=#{uname},tel=#{tel},text=#{text} WHERE id=#{id}")
    public void update(Product product);
}
